package com.axeiya.cheddargetter;

import org.jdom.Element;

public class SubscriptionItem {

	private String code;
	
	private String name;
	
	private int quantity;

	public SubscriptionItem(String code, String name, int quantity) {
		super();
		this.code = code;
		this.name = name;
		this.quantity = quantity;
	}
	
	public static SubscriptionItem parseSubscriptionItem(Element subscriptionItem){
		String code = subscriptionItem.getChildText("code");
		String name = subscriptionItem.getChildText("name");
		int quantity = Integer.valueOf(subscriptionItem.getChildText("quantity"));
		
		return new SubscriptionItem(code, name, quantity);
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	
	
	
}
